package com.stx.friends.action;

import java.util.ArrayList;
import java.util.List;

import com.opensymphony.xwork2.ActionSupport;
import com.stx.friends.service.RelationService;
import com.stx.friends.vo.RelationVo;
	
public class RelationAction extends ActionSupport{
	
	private RelationService service ;
	
	//关系信息列表
	private List<RelationVo> relationList = new ArrayList<RelationVo>();
	
	//关系查询条件
	private RelationVo criteria = null;
	
	//关系信息
	private RelationVo relation = null;
	
	//关系ID
	private String wrxUid = null;
	
	public String list() {

		relationList = service.list(new RelationVo());

		return "list";
	}
	
	public String del(){
		
		service.delRelation(wrxUid);
		
		return "list";
	}
	
	public String add(){
		
		service.addRelation(relation);
		
		return "list";
	}

	public void setService(RelationService service) {
		this.service = service;
	}

	public List<RelationVo> getRelationList() {
		return relationList;
	}

	public void setRelationList(List<RelationVo> relationList) {
		this.relationList = relationList;
	}

	public RelationVo getCriteria() {
		return criteria;
	}

	public void setCriteria(RelationVo criteria) {
		this.criteria = criteria;
	}

	public String getwrxUid() {
		return wrxUid;
	}

	public void setwrxUid(String wrxUid) {
		this.wrxUid = wrxUid;
	}

	public RelationVo getRelation() {
		return relation;
	}

	public void setRelation(RelationVo relation) {
		this.relation = relation;
	}
}
